package com.wc.alorithm_luogu._国赛模拟赛.D_方差;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/5/19 10:11
 * @description https://www.luogu.com.cn/problem/T437584?contestId=170180
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 2000010, P = 998244353;
    static long[] a = new long[N];
    static long[] sum = new long[N];
    static long[] sumf = new long[N];
    static int m, q;
    static long n;

    public static void main(String[] args) {
        n = sc.nextLong();
        m = sc.nextInt();
        q = sc.nextInt();
        int l, r;
        long b;
        while (m-- > 0) {
            l = sc.nextInt();
            r = sc.nextInt();
            b = sc.nextLong();
            a[l] += b;
            a[r + 1] += -b;
        }
        for (int i = 1; i <= n; i++) {
            a[i] += a[i - 1];
            a[i] %= P;
            sum[i] = (sum[i - 1] + a[i]) % P;
            sumf[i] = (sumf[i - 1] + a[i] * a[i] % P) % P;
        }
        while (q-- > 0) {
            l = sc.nextInt();
            r = sc.nextInt();
            long res = (((r - l + 1) * (sumf[r] - sumf[l - 1]) % P -
                    (sum[r] - sum[l - 1]) * (sum[r] - sum[l - 1]) % P) % P + P) % P;
            out.println(res);
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
